﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/NoLog.Master" Inherits="System.Web.Mvc.ViewPage<Rose.Models.RegisterModel>" %>

<asp:Content  ContentPlaceHolderID="ScriptContent" runat="server">
     <script type="text/javascript">
         $(document).ready(function () {
             $('#changecaptcha').click(function () {
                 document.getElementById('captcha').src = "/Account/GetCaptcha?random=" + Math.random();

             })
         });
        </script>
       <link rel="Stylesheet" href="../../Content/Css/registerform.css" type="text/css" />
</asp:Content>
<asp:Content ID="registerContent" ContentPlaceHolderID="MiddleContent" runat="server">
    <div id="headmessage"><h2>欢迎参加School Party</h2>
   
   </div>
    <p id="message"> <%=ViewData["Error"] %></p>

        
          <form method="post" action="<%=Url.Action("Register","Account") %>">
          <div id="accountform">
          <p><a class="laber">&nbsp;</a><a class="info"> <%=ViewData["Message"] %></a></p>
           <p><a class="laber">邮箱账号</a><a class="info"><%=Html.TextBoxFor(m=>m.UserName) %></a></p>
           <p><a class="laber">密码</a><a class="info"><%=Html.PasswordFor(m=>m.Password) %></a></p>
           <p><a class="laber">确认密码</a><a class="info"><%=Html.PasswordFor(m=>m.ConfirmPassword) %></a></p>
           
         
           <p><a class="laber">大学</a><a class="info"><%=Html.TextBoxFor(m=>m.University) %></a></p>
       
           <p><a class="laber">验证码</a><a class="info"><%=Html.TextBoxFor(m=>m.Captcha) %></a></p>
            <a id="yanzheng"><img id="captcha" src="/Account/GetCaptcha?random=1" /></a><a id="changecaptcha">看不清楚？换一张</a>

           <% string retUrl;
              if (!String.IsNullOrEmpty(Request.QueryString["returnUrl"]))
                  retUrl = Request.QueryString["returnUrl"];
              else if (!string.IsNullOrEmpty(Request.QueryString["ReturnUrl"]))
                  retUrl = Request.QueryString["ReturnUrl"];
                  
              else if (Request.UrlReferrer != null)
              {
                  if (Request.UrlReferrer.ToString().Contains("ReturnUrl="))
                  {
                      int index = Request.UrlReferrer.ToString().IndexOf("ReturnUrl=");
                      retUrl = Request.UrlReferrer.ToString().Substring(index+"ReturnUrl=".Length);
                  }
                  else
                      retUrl = Request.UrlReferrer.ToString();
              }
                  
              else retUrl = String.Empty;
               %>
           
           
            <input type="hidden" name="ReturnUrl" value="<%=retUrl %>" />
                

                
           </div>
           <p><a class="laber">&nbsp;</a><a class="info"><input type="submit" value="注册" /></a></p>
         
       
          </form>
         <br /><br /><br /><br /><br /><br />
       
   
   
</asp:Content>
